
  <?php 
        $status = $mr2->getStatus()?  $mr2->getStatus()  : 0;
        $action = CommonValues::$gMRStatus['action'][$status];
        ?>
<td>
<ul class="sf_admin_td_actions">
    <li>
    <?
       if (($status == CommonValues::$gMRApprovalStatus['key']['Approved']) && $sf_user->hasCredential('EDIT_MRSUBSTK'))
            echo link_to(image_tag('/sf/sf_admin/images/date.png', array('alt' => __('Change Date'), 'title' => __('Change Date'))), 'mr2/ChangeDate?id='.$mr2->getId());
    ?>
 </li>  
  <li><?php
  echo link_to(image_tag('/sf/sf_admin/images/edit.png', array('alt' => __('change no'), 'title' => __('change no'))), 'mr2/changeNumber?id='.$mr2->getId());
  
  if ($status == CommonValues::$gMRStatus['key']['Initial']) echo link_to(image_tag('/sf/sf_admin/images/delete_icon.png', array('alt' => __('delete'), 'title' => __('delete'))), 'mr2/delete?id='.$mr2->getId(), array (
  'post' => true,
  'confirm' => __('Are you sure you want to delete?'),
)); else
    {
      if ($sf_user->hasGroup('Administrator')) {
          echo link_to(image_tag('/sf/sf_admin/images/delete_icon.png', array('alt' => __('delete'), 'title' => __('delete'))), 'mr2/delete?id='.$mr2->getId(), array (
        'post' => true,
        'confirm' => __('Are you sure you want to delete this MR? This action will also delete all PO, TI related.'),
));
      }
    }
    ?></li>

<li>
<?
        if ($action=='COMPLETED') {
            echo image_tag('/sf/sf_admin/images/completed_icon.png', array('alt' => __('Completed'), 'title' => __('Completed')));
        } elseif ($action != 'UNACTION') {
            if ($mr2->getApprovalstatus()==CommonValues::$gMRApprovalStatus['key']['Waiting for approval'])
            {
                echo link_to(image_tag('/sf/sf_admin/images/' . 'cancel'. '_icon.png', array('alt' =>'cancel', 'title' => 'cancel')), 'mr2/'.'cancel'.'?id='.$mr2->getId(), array('confirm' => __('Are you sure you want to cancel?'),));
            
            }
            else {
                echo link_to(image_tag('/sf/sf_admin/images/' . $action. '_icon.png', array('alt' =>$action, 'title' => $action)), 'mr2/'.$action.'?id='.$mr2->getId(), array('confirm' => __('Are you sure you want to '.$action.'?'),));
            }
        }
    ?>
    </li>
<li>
<?
if ($status == CommonValues::$gMRStatus['key']['Rejected'])
    echo link_to(image_tag('/sf/sf_admin/images/viewnotes_icon.png', array('alt' => __('view notes'), 'title' => __('view notes'))), 'mr2/viewNotes?id='.$mr2->getId());
?>
</li>
    
<li>
<?
        if ($mr2->getStatus() !=CommonValues::$gMRStatus['key']['Initial'])
            echo link_to(image_tag('/sf/sf_admin/images/print.png', array('alt' => __('print'), 'title' => __('print'))), 'component/printMR?mr2_id='.$mr2->getId());
    ?>
</li>
</ul>
</td>
